package com.chinatsp.onlineapp.presenter;

import tsp.cn.http.BaseIDao;
import tsp.cn.http.HttpConfig;
import tsp.cn.http.interfac.INetResult;
import tsp.cn.http.tools.LogUtil;
import tsp.cn.http.tools.T;
import android.content.Context;

import com.chinatsp.onlineapp.base.Config;
import com.chinatsp.onlineapp.bean.DetailList;

import com.google.gson.Gson;

public class NewsDetailDao extends BaseIDao {
	Context context;
	DetailList list;

	public NewsDetailDao(Context context, INetResult iNetResult) {
		super(context, iNetResult);
		this.context = context;

	}

	@Override
	public void onRequestSuccess(String result, int requestCode) {

		// LogUtil.v("---开始处理---"+result);
		// T.showShort(context, result);
		LogUtil.d( "NewsDetailDao onRequestSuccess");
		list = new Gson().fromJson(result, DetailList.class);
	}

	public DetailList getList() {
		return this.list;
	}

	public void sendUrl(String newsId) {

		getRequest(new StringBuilder().append(HttpConfig.appendString())
				.append(Config.API_NEWS_DETAIL).append(newsId).append("/")
				.toString(), Config.CODE_NEWS_DETAIL);
	}

}
